home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / Devices.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  26.8 KB  |  822 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        Devices.h
  3.  
  4.      Contains:    Device Manager Interfaces.
  5.  
  6.      Version:    Technology:    Mac OS 8
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1985-1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __DEVICES__
  18. #define __DEVICES__
  19.  
  20. #ifndef __OSUTILS__
  21.     #include <OSUtils.h>
  22. #endif
  23.  
  24. #ifndef __FILES__
  25.     #include <Files.h>
  26. #endif
  27.  
  28. #ifndef __QUICKDRAW__
  29.     #include <Quickdraw.h>
  30. #endif
  31.  
  32. #ifndef __NAMEREGISTRY__
  33.     #include <NameRegistry.h>
  34. #endif
  35.  
  36. #ifndef __CODEFRAGMENTS__
  37.     #include <CodeFragments.h>
  38. #endif
  39.  
  40. #ifndef __DRIVERFAMILYMATCHING__
  41.     #include <DriverFamilyMatching.h>
  42. #endif
  43.  
  44.  
  45.  
  46.  
  47. #if PRAGMA_ONCE
  48. #pragma once
  49. #endif
  50.  
  51. #ifdef __cplusplus
  52. extern "C" {
  53. #endif
  54.  
  55. #if PRAGMA_IMPORT
  56. #pragma import on
  57. #endif
  58.  
  59. #if PRAGMA_STRUCT_ALIGN
  60.     #pragma options align=mac68k
  61. #elif PRAGMA_STRUCT_PACKPUSH
  62.     #pragma pack(push, 2)
  63. #elif PRAGMA_STRUCT_PACK
  64.     #pragma pack(2)
  65. #endif
  66.  
  67. /* Values of the 'message' parameter to a Chooser device package */
  68. enum {
  69.     chooserInitMsg                = 11,                            /* the user selected this device package */
  70.     newSelMsg                    = 12,                            /* the user made new device selections */
  71.     fillListMsg                    = 13,                            /* fill the device list with choices */
  72.     getSelMsg                    = 14,                            /* mark one or more choices as selected */
  73.     selectMsg                    = 15,                            /* the user made a selection */
  74.     deselectMsg                    = 16,                            /* the user canceled a selection */
  75.     terminateMsg                = 17,                            /* allows device package to clean up */
  76.     buttonMsg                    = 19                            /* the user selected a button */
  77. };
  78.  
  79.  
  80. /* Values of the 'caller' parameter to a Chooser device package */
  81. enum {
  82.     chooserID                    = 1
  83. };
  84.  
  85.  
  86. /* Values of the 'message' parameter to a Monitor 'mntr' */
  87. enum {
  88.     initMsg                        = 1,                            /*initialization*/
  89.     okMsg                        = 2,                            /*user clicked OK button*/
  90.     cancelMsg                    = 3,                            /*user clicked Cancel button*/
  91.     hitMsg                        = 4,                            /*user clicked control in Options dialog*/
  92.     nulMsg                        = 5,                            /*periodic event*/
  93.     updateMsg                    = 6,                            /*update event*/
  94.     activateMsg                    = 7,                            /*not used*/
  95.     deactivateMsg                = 8,                            /*not used*/
  96.     keyEvtMsg                    = 9,                            /*keyboard event*/
  97.     superMsg                    = 10,                            /*show superuser controls*/
  98.     normalMsg                    = 11,                            /*show only normal controls*/
  99.     startupMsg                    = 12                            /*code has been loaded*/
  100. };
  101.  
  102.  
  103. /* control codes for DeskAccessories */
  104. enum {
  105.     goodbye                        = -1,                            /* heap being reinitialized */
  106.     killCode                    = 1,                            /* KillIO requested */
  107.     accEvent                    = 64,                            /* handle an event */
  108.     accRun                        = 65,                            /* time for periodic action */
  109.     accCursor                    = 66,                            /* change cursor shape */
  110.     accMenu                        = 67,                            /* handle menu item */
  111.     accUndo                        = 68,                            /* handle undo command */
  112.     accCut                        = 70,                            /* handle cut command */
  113.     accCopy                        = 71,                            /* handle copy command */
  114.     accPaste                    = 72,                            /* handle paste command */
  115.     accClear                    = 73                            /* handle clear command */
  116. };
  117.  
  118. /* Control/Status Call Codes */
  119. enum {
  120.     drvStsCode                    = 8,                            /* status call code for drive status */
  121.     ejectCode                    = 7,                            /* control call eject code */
  122.     tgBuffCode                    = 8                                /* set tag buffer code */
  123. };
  124.  
  125. /* miscellaneous Device Manager constants */
  126. enum {
  127.     ioInProgress                = 1,                            /* predefined value of ioResult while I/O is pending */
  128.     aRdCmd                        = 2,                            /* low byte of ioTrap for Read calls */
  129.     aWrCmd                        = 3,                            /* low byte of ioTrap for Write calls */
  130.     asyncTrpBit                    = 10,                            /* trap word modifier */
  131.     noQueueBit                    = 9                                /* trap word modifier */
  132. };
  133.  
  134. /* flags used in the driver header and device control entry */
  135. enum {
  136.     dReadEnable                    = 0,                            /* set if driver responds to read requests */
  137.     dWritEnable                    = 1,                            /* set if driver responds to write requests */
  138.     dCtlEnable                    = 2,                            /* set if driver responds to control requests */
  139.     dStatEnable                    = 3,                            /* set if driver responds to status requests */
  140.     dNeedGoodBye                = 4,                            /* set if driver needs time for performing periodic tasks */
  141.     dNeedTime                    = 5,                            /* set if driver needs time for performing periodic tasks */
  142.     dNeedLock                    = 6                                /* set if driver must be locked in memory as soon as it is opened */
  143. };
  144.  
  145. enum {
  146.     dNeedLockMask                = 0x4000,                        /* set if driver must be locked in memory as soon as it is opened */
  147.     dNeedTimeMask                = 0x2000,                        /* set if driver needs time for performing periodic tasks */
  148.     dNeedGoodByeMask            = 0x1000,                        /* set if driver needs to be called before the application heap is initialized */
  149.     dStatEnableMask                = 0x0800,                        /* set if driver responds to status requests */
  150.     dCtlEnableMask                = 0x0400,                        /* set if driver responds to control requests */
  151.     dWritEnableMask                = 0x0200,                        /* set if driver responds to write requests */
  152.     dReadEnableMask                = 0x0100                        /* set if driver responds to read requests */
  153. };
  154.  
  155.  
  156. /* run-time flags used in the device control entry */
  157. enum {
  158.     dVMImmuneBit                = 0,                            /* driver does not need VM protection */
  159.     dOpened                        = 5,                            /* driver is open */
  160.     dRAMBased                    = 6,                            /* dCtlDriver is a handle (1) or pointer (0) */
  161.     drvrActive                    = 7                                /* driver is currently processing a request */
  162. };
  163.  
  164. enum {
  165.     dVMImmuneMask                = 0x0001,                        /* driver does not need VM protection */
  166.     dOpenedMask                    = 0x0020,                        /* driver is open */
  167.     dRAMBasedMask                = 0x0040,                        /* dCtlDriver is a handle (1) or pointer (0) */
  168.     drvrActiveMask                = 0x0080                        /* driver is currently processing a request */
  169. };
  170.  
  171.  
  172.  
  173. struct DRVRHeader {
  174.     short                             drvrFlags;
  175.     short                             drvrDelay;
  176.     short                             drvrEMask;
  177.     short                             drvrMenu;
  178.     short                             drvrOpen;
  179.     short                             drvrPrime;
  180.     short                             drvrCtl;
  181.     short                             drvrStatus;
  182.     short                             drvrClose;
  183.     unsigned char                     drvrName[1];
  184. };
  185. typedef struct DRVRHeader                DRVRHeader;
  186. typedef DRVRHeader *                    DRVRHeaderPtr;
  187. typedef DRVRHeaderPtr *                    DRVRHeaderHandle;
  188.  
  189. struct DCtlEntry {
  190.     Ptr                             dCtlDriver;
  191.     volatile short                     dCtlFlags;
  192.     QHdr                             dCtlQHdr;
  193.     volatile long                     dCtlPosition;
  194.     Handle                             dCtlStorage;
  195.     short                             dCtlRefNum;
  196.     long                             dCtlCurTicks;
  197.     GrafPtr                         dCtlWindow;
  198.     short                             dCtlDelay;
  199.     short                             dCtlEMask;
  200.     short                             dCtlMenu;
  201. };
  202. typedef struct DCtlEntry                DCtlEntry;
  203.  
  204. typedef DCtlEntry *                        DCtlPtr;
  205. typedef DCtlPtr *                        DCtlHandle;
  206.  
  207. struct AuxDCE {
  208.     Ptr                             dCtlDriver;
  209.     volatile short                     dCtlFlags;
  210.     QHdr                             dCtlQHdr;
  211.     long                             dCtlPosition;
  212.     Handle                             dCtlStorage;
  213.     short                             dCtlRefNum;
  214.     long                             dCtlCurTicks;
  215.     GrafPtr                         dCtlWindow;
  216.     short                             dCtlDelay;
  217.     short                             dCtlEMask;
  218.     short                             dCtlMenu;
  219.     SInt8                             dCtlSlot;
  220.     SInt8                             dCtlSlotId;
  221.     long                             dCtlDevBase;
  222.     Ptr                             dCtlOwner;
  223.     SInt8                             dCtlExtDev;
  224.     SInt8                             fillByte;
  225.     UInt32                             dCtlNodeID;
  226. };
  227. typedef struct AuxDCE                    AuxDCE;
  228. typedef AuxDCE *                        AuxDCEPtr;
  229. typedef AuxDCEPtr *                        AuxDCEHandle;
  230. /*    The NDRV Driver IO Entry Point and Commands */
  231.  
  232. typedef UInt16                             UnitNumber;
  233. typedef UInt32                             DriverOpenCount;
  234. typedef SInt16                             DriverRefNum;
  235. typedef SInt16                             DriverFlags;
  236. typedef UInt32                             IOCommandCode;
  237. enum {
  238.     kOpenCommand                = 0,
  239.     kCloseCommand                = 1,
  240.     kReadCommand                = 2,
  241.     kWriteCommand                = 3,
  242.     kControlCommand                = 4,
  243.     kStatusCommand                = 5,
  244.     kKillIOCommand                = 6,
  245.     kInitializeCommand            = 7,                            /* init driver and device*/
  246.     kFinalizeCommand            = 8,                            /* shutdown driver and device*/
  247.     kReplaceCommand                = 9,                            /* replace an old driver*/
  248.     kSupersededCommand            = 10,                            /* prepare to be replaced by a new driver*/
  249.     kSuspendCommand                = 11,                            /* prepare driver to go to sleep*/
  250.     kResumeCommand                = 12                            /* wake up sleeping driver*/
  251. };
  252.  
  253. typedef struct OpaqueAddressSpaceID*     AddressSpaceID;
  254. typedef struct OpaqueIOCommandID*         IOCommandID;
  255. typedef UInt32                             IOCommandKind;
  256. enum {
  257.     kSynchronousIOCommandKind    = 0x00000001,
  258.     kAsynchronousIOCommandKind    = 0x00000002,
  259.     kImmediateIOCommandKind        = 0x00000004
  260. };
  261.  
  262.  
  263. struct DriverInitInfo {
  264.     DriverRefNum                     refNum;
  265.     RegEntryID                         deviceEntry;
  266. };
  267. typedef struct DriverInitInfo            DriverInitInfo;
  268. typedef DriverInitInfo *                DriverInitInfoPtr;
  269.  
  270. typedef DriverInitInfo                     DriverReplaceInfo;
  271. typedef DriverInitInfo *                DriverReplaceInfoPtr;
  272.  
  273. struct DriverFinalInfo {
  274.     DriverRefNum                     refNum;
  275.     RegEntryID                         deviceEntry;
  276. };
  277. typedef struct DriverFinalInfo            DriverFinalInfo;
  278. typedef DriverFinalInfo *                DriverFinalInfoPtr;
  279.  
  280. typedef DriverFinalInfo                 DriverSupersededInfo;
  281. typedef DriverFinalInfo *                DriverSupersededInfoPtr;
  282.  
  283. /* Contents are command specific*/
  284.  
  285.  
  286. union IOCommandContents {
  287.     ParmBlkPtr                         pb;
  288.     DriverInitInfoPtr                 initialInfo;
  289.     DriverFinalInfoPtr                 finalInfo;
  290.     DriverReplaceInfoPtr             replaceInfo;
  291.     DriverSupersededInfoPtr         supersededInfo;
  292. };
  293. typedef union IOCommandContents            IOCommandContents;
  294. typedef CALLBACK_API_C( OSErr , DriverEntryPointPtr )(AddressSpaceID SpaceID, IOCommandID CommandID, IOCommandContents Contents, IOCommandCode Code, IOCommandKind Kind);
  295. /* Record to describe a file-based driver candidate */
  296.  
  297. struct FileBasedDriverRecord {
  298.     FSSpec                             theSpec;                    /* file specification*/
  299.     MacDriverType                     theType;                    /* nameInfoStr + version number*/
  300.     Boolean                         compatibleProp;                /* true if matched using a compatible name*/
  301.     UInt8                             pad[3];                        /* alignment*/
  302. };
  303. typedef struct FileBasedDriverRecord    FileBasedDriverRecord;
  304. typedef FileBasedDriverRecord *            FileBasedDriverRecordPtr;
  305. /* Detailed Record to describe a file-based driver candidate. Includes fragment name */
  306.  
  307. struct FileBasedDriverDetailed {
  308.     FileBasedDriverRecord             fileBasedDriver;
  309.     Str63                             fragName;
  310. };
  311. typedef struct FileBasedDriverDetailed    FileBasedDriverDetailed;
  312. typedef FileBasedDriverDetailed *        FileBasedDriverDetailedPtr;
  313. /* Driver Loader API */
  314. #define DECLARE_DRIVERDESCRIPTION(N_ADDITIONAL_SERVICES)\
  315.         struct {\
  316.             DriverDescription    fixed;\
  317.             DriverServiceInfo    additional_service[N_ADDITIONAL_SERVICES-1];\
  318.         };
  319.  
  320.  
  321. EXTERN_API_C( SInt16 )
  322. HigherDriverVersion                (const NumVersion *        driverVersion1,
  323.                                  const NumVersion *        driverVersion2);
  324.  
  325. EXTERN_API_C( OSErr )
  326. VerifyFragmentAsDriver            (CFragConnectionID         fragmentConnID,
  327.                                  DriverEntryPointPtr *    fragmentMain,
  328.                                  DriverDescriptionPtr *    driverDesc);
  329.  
  330. EXTERN_API_C( OSErr )
  331. GetDriverMemoryFragment            (Ptr                     memAddr,
  332.                                  long                     length,
  333.                                  ConstStr63Param         fragName,
  334.                                  CFragConnectionID *    fragmentConnID,
  335.                                  DriverEntryPointPtr *    fragmentMain,
  336.                                  DriverDescriptionPtr *    driverDesc);
  337.  
  338. EXTERN_API_C( OSErr )
  339. GetDriverDiskFragment            (FSSpecPtr                 fragmentSpec,
  340.                                  CFragConnectionID *    fragmentConnID,
  341.                                  DriverEntryPointPtr *    fragmentMain,
  342.                                  DriverDescriptionPtr *    driverDesc);
  343.  
  344. EXTERN_API_C( OSErr )
  345. GetNamedDriverDiskFragment        (FSSpecPtr                 fragmentSpec,
  346.                                  ConstStr63Param         fragName,
  347.                                  CFragConnectionID *    fragmentConnID,
  348.                                  DriverEntryPointPtr *    fragmentMain,
  349.                                  DriverDescriptionPtr *    driverDesc);
  350.  
  351. EXTERN_API_C( OSErr )
  352. InstallDriverFromFragment        (CFragConnectionID         fragmentConnID,
  353.                                  RegEntryID *            device,
  354.                                  UnitNumber             beginningUnit,
  355.                                  UnitNumber             endingUnit,
  356.                                  DriverRefNum *            refNum);
  357.  
  358. EXTERN_API_C( OSErr )
  359. InstallDriverFromFile            (FSSpecPtr                 fragmentSpec,
  360.                                  RegEntryID *            device,
  361.                                  UnitNumber             beginningUnit,
  362.                                  UnitNumber             endingUnit,
  363.                                  DriverRefNum *            refNum);
  364.  
  365. EXTERN_API_C( OSErr )
  366. InstallDriverFromMemory            (Ptr                     memory,
  367.                                  long                     length,
  368.                                  ConstStr63Param         fragName,
  369.                                  RegEntryID *            device,
  370.                                  UnitNumber             beginningUnit,
  371.                                  UnitNumber             endingUnit,
  372.                                  DriverRefNum *            refNum);
  373.  
  374. EXTERN_API_C( OSErr )
  375. InstallDriverFromResource        (SInt16                 theRsrcID,
  376.                                  ConstStr255Param         theRsrcName,
  377.                                  RegEntryIDPtr             theDevice,
  378.                                  UnitNumber             theBeginningUnit,
  379.                                  UnitNumber             theEndingUnit,
  380.                                  DriverRefNum *            theRefNum);
  381.  
  382. EXTERN_API_C( OSErr )
  383. InstallDriverFromDisk            (Ptr                     theDriverName,
  384.                                  RegEntryID *            theDevice,
  385.                                  UnitNumber             theBeginningUnit,
  386.                                  UnitNumber             theEndingUnit,
  387.                                  DriverRefNum *            theRefNum);
  388.  
  389. EXTERN_API_C( OSErr )
  390. FindDriversForDevice            (RegEntryID *            device,
  391.                                  FSSpec *                fragmentSpec,
  392.                                  DriverDescription *    fileDriverDesc,
  393.                                  Ptr *                    memAddr,
  394.                                  long *                    length,
  395.                                  StringPtr                 fragName,
  396.                                  DriverDescription *    memDriverDesc);
  397.  
  398. EXTERN_API_C( OSErr )
  399. FindDriverForDeviceFromFile        (RegEntryID *            device,
  400.                                  FSSpec *                fragmentSpec,
  401.                                  DriverDescription *    driverDesc,
  402.                                  StringPtr                 fragName);
  403.  
  404. EXTERN_API_C( OSErr )
  405. FindDriverCandidates            (RegEntryID *            deviceID,
  406.                                  Ptr *                    propBasedDriver,
  407.                                  RegPropertyValueSize *    propBasedDriverSize,
  408.                                  StringPtr                 deviceName,
  409.                                  MacDriverType *        propBasedDriverType,
  410.                                  Boolean *                gotPropBasedDriver,
  411.                                  FileBasedDriverRecordPtr  fileBasedDrivers,
  412.                                  ItemCount *            nFileBasedDrivers);
  413.  
  414. EXTERN_API_C( OSErr )
  415. FindDriverCandidatesDetailed    (RegEntryIDPtr             deviceID,
  416.                                  Ptr *                    propBasedDriver,
  417.                                  RegPropertyValueSize *    propBasedDriverSize,
  418.                                  StringPtr                 deviceName,
  419.                                  MacDriverType *        propBasedDriverType,
  420.                                  Boolean *                gotPropBasedDriver,
  421.                                  FileBasedDriverDetailedPtr  fileBasedDrivers,
  422.                                  ItemCount *            nFileBasedDrivers);
  423.  
  424. EXTERN_API_C( OSErr )
  425. ScanDriverCandidates            (RegEntryID *            deviceID,
  426.                                  FileBasedDriverRecordPtr  fileBasedDrivers,
  427.                                  ItemCount                 nFileBasedDrivers,
  428.                                  FileBasedDriverRecordPtr  matchingDrivers,
  429.                                  ItemCount *            nMatchingDrivers);
  430.  
  431. EXTERN_API_C( OSErr )
  432. ScanDriverCandidatesDetailed    (RegEntryID *            deviceID,
  433.                                  FileBasedDriverDetailedPtr  fileBasedDrivers,
  434.                                  ItemCount                 nFileBasedDrivers,
  435.                                  FileBasedDriverDetailedPtr  matchingDrivers,
  436.                                  ItemCount *            nMatchingDrivers);
  437.  
  438. EXTERN_API_C( SInt16 )
  439. CompareFileCandToPropCand        (RegEntryID *            device,
  440.                                  StringPtr                 deviceName,
  441.                                  DriverTypePtr             propBasedCandidate,
  442.                                  FileBasedDriverRecordPtr  fileBasedCandidate);
  443.  
  444. EXTERN_API_C( void )
  445. GetCompatibleProperty            (RegEntryID *            device,
  446.                                  StringPtr *            compatibleNames,
  447.                                  ItemCount *            nCompatibleNames);
  448.  
  449. EXTERN_API_C( Boolean )
  450. CompatibleDriverNames            (StringPtr                 nameInfoStr,
  451.                                  StringPtr                 compatibleNames,
  452.                                  ItemCount                 nCompatibleNames,
  453.                                  long *                    nameCount);
  454.  
  455. EXTERN_API_C( OSErr )
  456. GetDriverForDevice                (RegEntryID *            device,
  457.                                  CFragConnectionID *    fragmentConnID,
  458.                                  DriverEntryPointPtr *    fragmentMain,
  459.                                  DriverDescriptionPtr *    driverDesc);
  460.  
  461. EXTERN_API_C( OSErr )
  462. InstallDriverForDevice            (RegEntryID *            device,
  463.                                  UnitNumber             beginningUnit,
  464.                                  UnitNumber             endingUnit,
  465.                                  DriverRefNum *            refNum);
  466.  
  467. EXTERN_API_C( OSErr )
  468. GetDriverInformation            (DriverRefNum             refNum,
  469.                                  UnitNumber *            unitNum,
  470.                                  DriverFlags *            flags,
  471.                                  DriverOpenCount *        count,
  472.                                  StringPtr                 name,
  473.                                  RegEntryID *            device,
  474.                                  CFragSystem7Locator *    driverLoadLocation,
  475.                                  CFragConnectionID *    fragmentConnID,
  476.                                  DriverEntryPointPtr *    fragmentMain,
  477.                                  DriverDescription *    driverDesc);
  478.  
  479. EXTERN_API_C( OSErr )
  480. GetDriverDescription            (LogicalAddress         fragmentPtr,
  481.                                  DriverDescriptionPtr *    theDriverDesc);
  482.  
  483. EXTERN_API_C( OSStatus )
  484. GetNamedDriverDescFromFSSpec    (FSSpecPtr                 fragmentSpec,
  485.                                  StringPtr                 fragName,
  486.                                  DriverDescriptionPtr *    driverDesc);
  487.  
  488. EXTERN_API_C( OSErr )
  489. SetDriverClosureMemory            (CFragConnectionID         fragmentConnID,
  490.                                  Boolean                 holdDriverMemory);
  491.  
  492. EXTERN_API_C( OSErr )
  493. ReplaceDriverWithFragment        (DriverRefNum             theRefNum,
  494.                                  CFragConnectionID         fragmentConnID);
  495.  
  496. EXTERN_API_C( OSErr )
  497. OpenInstalledDriver                (DriverRefNum             refNum,
  498.                                  SInt8                     ioPermission);
  499.  
  500. EXTERN_API_C( OSErr )
  501. RenameDriver                    (DriverRefNum             refNum,
  502.                                  StringPtr                 newDriverName);
  503.  
  504. EXTERN_API_C( OSErr )
  505. RemoveDriver                    (DriverRefNum             refNum,
  506.                                  Boolean                 immediate);
  507.  
  508. EXTERN_API_C( OSErr )
  509. LookupDrivers                    (UnitNumber             beginningUnit,
  510.                                  UnitNumber             endingUnit,
  511.                                  Boolean                 emptyUnits,
  512.                                  ItemCount *            returnedRefNums,
  513.                                  DriverRefNum *            refNums);
  514.  
  515. EXTERN_API_C( UnitNumber )
  516. HighestUnitNumber                (void);
  517.  
  518. EXTERN_API_C( OSErr )
  519. DriverGestaltOn                    (DriverRefNum             refNum);
  520.  
  521. EXTERN_API_C( OSErr )
  522. DriverGestaltOff                (DriverRefNum             refNum);
  523.  
  524. EXTERN_API_C( Boolean )
  525. DriverGestaltIsOn                (DriverFlags             flags);
  526.  
  527.  
  528.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  529.                                                                                             #pragma parameter __D0 PBOpenSync(__A0)
  530.                                                                                             #endif
  531. EXTERN_API( OSErr )
  532. PBOpenSync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA000);
  533.  
  534.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  535.                                                                                             #pragma parameter __D0 PBOpenAsync(__A0)
  536.                                                                                             #endif
  537. EXTERN_API( OSErr )
  538. PBOpenAsync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA400);
  539.  
  540.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  541.                                                                                             #pragma parameter __D0 PBOpenImmed(__A0)
  542.                                                                                             #endif
  543. EXTERN_API( OSErr )
  544. PBOpenImmed                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA200);
  545.  
  546.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  547.                                                                                             #pragma parameter __D0 PBCloseSync(__A0)
  548.                                                                                             #endif
  549. EXTERN_API( OSErr )
  550. PBCloseSync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA001);
  551.  
  552.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  553.                                                                                             #pragma parameter __D0 PBCloseAsync(__A0)
  554.                                                                                             #endif
  555. EXTERN_API( OSErr )
  556. PBCloseAsync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA401);
  557.  
  558.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  559.                                                                                             #pragma parameter __D0 PBCloseImmed(__A0)
  560.                                                                                             #endif
  561. EXTERN_API( OSErr )
  562. PBCloseImmed                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA201);
  563.  
  564.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  565.                                                                                             #pragma parameter __D0 PBReadSync(__A0)
  566.                                                                                             #endif
  567. EXTERN_API( OSErr )
  568. PBReadSync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA002);
  569.  
  570.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  571.                                                                                             #pragma parameter __D0 PBReadAsync(__A0)
  572.                                                                                             #endif
  573. EXTERN_API( OSErr )
  574. PBReadAsync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA402);
  575.  
  576.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  577.                                                                                             #pragma parameter __D0 PBReadImmed(__A0)
  578.                                                                                             #endif
  579. EXTERN_API( OSErr )
  580. PBReadImmed                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA202);
  581.  
  582.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  583.                                                                                             #pragma parameter __D0 PBWriteSync(__A0)
  584.                                                                                             #endif
  585. EXTERN_API( OSErr )
  586. PBWriteSync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA003);
  587.  
  588.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  589.                                                                                             #pragma parameter __D0 PBWriteAsync(__A0)
  590.                                                                                             #endif
  591. EXTERN_API( OSErr )
  592. PBWriteAsync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA403);
  593.  
  594.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  595.                                                                                             #pragma parameter __D0 PBWriteImmed(__A0)
  596.                                                                                             #endif
  597. EXTERN_API( OSErr )
  598. PBWriteImmed                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA203);
  599.  
  600. /*
  601.     PBWaitIOComplete is a friendly way for applications to monitor
  602.     a pending asynchronous I/O operation in power-managed and
  603.     preemptive multitasking systems.
  604.  */
  605. EXTERN_API( OSErr )
  606. PBWaitIOComplete                (ParmBlkPtr             paramBlock,
  607.                                  Duration                 timeout);
  608.  
  609.  
  610. EXTERN_API( void )
  611. AddDrive                        (short                     drvrRefNum,
  612.                                  short                     drvNum,
  613.                                  DrvQElPtr                 qEl);
  614.  
  615. #if CALL_NOT_IN_CARBON
  616. EXTERN_API( QHdrPtr )
  617. GetDrvQHdr                        (void)                                                        THREEWORDINLINE(0x2EBC, 0x0000, 0x0308);
  618.  
  619.  
  620. EXTERN_API( DCtlHandle )
  621. GetDCtlEntry                    (short                     refNum);
  622.  
  623. #endif  /* CALL_NOT_IN_CARBON */
  624.  
  625. /*
  626.     SetChooserAlert used to simply set a bit in a low-mem global
  627.     to tell the Chooser not to display its warning message when
  628.     the printer is changed. However, under MultiFinder and System 7,
  629.     this low-mem is swapped out when a layer change occurs, and the
  630.     Chooser never sees the change. It is obsolete, and completely
  631.     unsupported on the PowerPC. 68K apps can still call it if they
  632.     wish.
  633.     
  634.     pascal Boolean SetChooserAlert(Boolean f);
  635.  
  636. */
  637.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  638.                                                                                             #pragma parameter __D0 DriverInstall(__A0, __D0)
  639.                                                                                             #endif
  640. EXTERN_API( OSErr )
  641. DriverInstall                    (DRVRHeaderPtr             drvrPtr,
  642.                                  short                     refNum)                                ONEWORDINLINE(0xA03D);
  643.  
  644.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  645.                                                                                             #pragma parameter __D0 DriverInstallReserveMem(__A0, __D0)
  646.                                                                                             #endif
  647. EXTERN_API( OSErr )
  648. DriverInstallReserveMem            (DRVRHeaderPtr             drvrPtr,
  649.                                  short                     refNum)                                ONEWORDINLINE(0xA43D);
  650.  
  651. /*
  652.   Note: DrvrInstall() is no longer supported, becuase it never really worked anyways.
  653.           There will soon be a DriverInstall() which does the right thing.
  654.  
  655.         DrvrRemove has been renamed to DriverRemove.  But, InterfaceLib for PowerPC
  656.         still exports DrvrRemove, so a macro is used to map the new name to old.
  657.  
  658. */
  659.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  660.                                                                                             #pragma parameter __D0 DrvrRemove(__D0)
  661.                                                                                             #endif
  662. EXTERN_API( OSErr )
  663. DrvrRemove                        (short                     refNum)                                ONEWORDINLINE(0xA03E);
  664.  
  665. #define DriverRemove(refNum) DrvrRemove(refNum)
  666.  
  667. #if TARGET_OS_MAC
  668.     #define MacOpenDriver OpenDriver
  669. #endif
  670. EXTERN_API( OSErr )
  671. MacOpenDriver                    (ConstStr255Param         name,
  672.                                  short *                drvrRefNum);
  673.  
  674. #if TARGET_OS_MAC
  675.     #define MacCloseDriver CloseDriver
  676. #endif
  677. EXTERN_API( OSErr )
  678. MacCloseDriver                    (short                     refNum);
  679.  
  680. EXTERN_API( OSErr )
  681. Control                            (short                     refNum,
  682.                                  short                     csCode,
  683.                                  const void *            csParamPtr);
  684.  
  685. EXTERN_API( OSErr )
  686. Status                            (short                     refNum,
  687.                                  short                     csCode,
  688.                                  void *                    csParamPtr);
  689.  
  690. EXTERN_API( OSErr )
  691. KillIO                            (short                     refNum);
  692.  
  693.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  694.                                                                                             #pragma parameter __D0 Fetch(__A1)
  695.                                                                                             #endif
  696. EXTERN_API( long )
  697. Fetch                            (DCtlPtr                 dce)                                THREEWORDINLINE(0x2078, 0x08F4, 0x4E90);
  698.  
  699.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  700.                                                                                             #pragma parameter __D0 Stash(__A1, __D0)
  701.                                                                                             #endif
  702. EXTERN_API( long )
  703. Stash                            (DCtlPtr                 dce,
  704.                                  char                     data)                                THREEWORDINLINE(0x2078, 0x08F8, 0x4E90);
  705.  
  706.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  707.                                                                                             #pragma parameter IODone(__A1, __D0)
  708.                                                                                             #endif
  709. EXTERN_API( void )
  710. IODone                            (DCtlPtr                 dce,
  711.                                  OSErr                     ioResult)                            THREEWORDINLINE(0x2078, 0x08FC, 0x4E90);
  712.  
  713.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  714.                                                                                             #pragma parameter __D0 PBControlSync(__A0)
  715.                                                                                             #endif
  716. EXTERN_API( OSErr )
  717. PBControlSync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA004);
  718.  
  719.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  720.                                                                                             #pragma parameter __D0 PBControlAsync(__A0)
  721.                                                                                             #endif
  722. EXTERN_API( OSErr )
  723. PBControlAsync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA404);
  724.  
  725.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  726.                                                                                             #pragma parameter __D0 PBControlImmed(__A0)
  727.                                                                                             #endif
  728. EXTERN_API( OSErr )
  729. PBControlImmed                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA204);
  730.  
  731. #if CALL_NOT_IN_CARBON
  732.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  733.                                                                                             #pragma parameter __D0 PBStatusSync(__A0)
  734.                                                                                             #endif
  735. EXTERN_API( OSErr )
  736. PBStatusSync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA005);
  737.  
  738. #endif  /* CALL_NOT_IN_CARBON */
  739.  
  740.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  741.                                                                                             #pragma parameter __D0 PBStatusAsync(__A0)
  742.                                                                                             #endif
  743. EXTERN_API( OSErr )
  744. PBStatusAsync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA405);
  745.  
  746.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  747.                                                                                             #pragma parameter __D0 PBStatusImmed(__A0)
  748.                                                                                             #endif
  749. EXTERN_API( OSErr )
  750. PBStatusImmed                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA205);
  751.  
  752.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  753.                                                                                             #pragma parameter __D0 PBKillIOSync(__A0)
  754.                                                                                             #endif
  755. EXTERN_API( OSErr )
  756. PBKillIOSync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA006);
  757.  
  758.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  759.                                                                                             #pragma parameter __D0 PBKillIOAsync(__A0)
  760.                                                                                             #endif
  761. EXTERN_API( OSErr )
  762. PBKillIOAsync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA406);
  763.  
  764.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  765.                                                                                             #pragma parameter __D0 PBKillIOImmed(__A0)
  766.                                                                                             #endif
  767. EXTERN_API( OSErr )
  768. PBKillIOImmed                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA206);
  769.  
  770. EXTERN_API( short )
  771. OpenDeskAcc                        (ConstStr255Param         deskAccName)                        ONEWORDINLINE(0xA9B6);
  772.  
  773. EXTERN_API( void )
  774. CloseDeskAcc                    (short                     refNum)                                ONEWORDINLINE(0xA9B7);
  775.  
  776. EXTERN_API_C( short )
  777. opendeskacc                        (const char *            deskAccName);
  778.  
  779. EXTERN_API_C( OSErr )
  780. opendriver                        (const char *            driverName,
  781.                                  short *                refNum);
  782.  
  783. /*
  784.     The PBxxx() routines are obsolete.  
  785.     
  786.     Use the PBxxxSync(), PBxxxAsync(), or PBxxxImmed version instead.
  787. */
  788. #define PBControl(pb, async) ((async) ? PBControlAsync(pb) : PBControlSync(pb))
  789. #define PBStatus(pb, async) ((async) ? PBStatusAsync(pb) : PBStatusSync(pb))
  790. #define PBKillIO(pb, async) ((async) ? PBKillIOAsync(pb) : PBKillIOSync(pb))
  791.  
  792. #define PBOpen(pb, async) ((async) ? PBOpenAsync(pb) : PBOpenSync(pb))
  793. #define PBClose(pb, async) ((async) ? PBCloseAsync(pb) : PBCloseSync(pb))
  794. #define PBRead(pb, async) ((async) ? PBReadAsync(pb) : PBReadSync(pb))
  795. #define PBWrite(pb, async) ((async) ? PBWriteAsync(pb) : PBWriteSync(pb))
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802. #if PRAGMA_STRUCT_ALIGN
  803.     #pragma options align=reset
  804. #elif PRAGMA_STRUCT_PACKPUSH
  805.     #pragma pack(pop)
  806. #elif PRAGMA_STRUCT_PACK
  807.     #pragma pack()
  808. #endif
  809.  
  810. #ifdef PRAGMA_IMPORT_OFF
  811. #pragma import off
  812. #elif PRAGMA_IMPORT
  813. #pragma import reset
  814. #endif
  815.  
  816. #ifdef __cplusplus
  817. }
  818. #endif
  819.  
  820. #endif /* __DEVICES__ */
  821.  
  822.